<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  .box {
    margin: 100px auto;
    width: 400px;
    height: 300px;
  }

  input {
    width: 400px;
    height: 30px;
    border: 1px solid black;
    color: gray;
    outline: none;
  }

  ul {
    margin-top: 0px;
    width: 360px;
    height: 250px;
    border: 2px solid #ff6700;
    display: none;
  }

  ul li {
    cursor: pointer;
    margin-top: 10px;
    list-style: none;
    color: gray
  }
</style>

<body>
  <div class="box">
    <input type="text" name="" id="" value="小米笔记本">
    <ul>
      <li>全部商品</li>
      <li>小米11</li>
      <li>小米10S</li>
      <li>小米笔记本</li>
      <li>小米手机</li>
      <li>黑鲨4</li>
      <li>空调</li>
    </ul>
  </div>
  <script>
    const ul = document.querySelector('ul')
    const inp = document.querySelector('input')
    inp.addEventListener('blur', function () {
      ul.style.display = 'none'
    })
    inp.addEventListener('focus', function () {
      ul.style.display = 'block'
      inp.style.border = '2px solid #ff6700'
    })
    // fskdjfksjewfsf
  </script>
</body>

</html>